import {defineStore} from "pinia"
import {computed, ref} from "vue"
//组合式,第二个参数写函数
export default defineStore('composition', () => {
    //相当于state
    let name = ref('composition-pinia')
    //相当于action
    let changeName = () => {
        name.value = '李雷'
    }
    //getters?

    let reverseName = computed(() => {
        return name.value.split("").reverse().join("")
    })

    return {name, changeName, reverseName}
})